﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Sudoku
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private void solveButton_Click(object sender, RoutedEventArgs e)
        {
            sudokuControl.BeginSolve();
        }

        private void checkButton_Click(object sender, RoutedEventArgs e)
        {
            if (sudokuControl.Check(true))
            {
                if (sudokuControl.IsDone())
                    statusTextBlock.Text = "Sudoku solved correctly!";
                else
                    statusTextBlock.Text = "Looks good so far.";
            }
            else
            {
                statusTextBlock.Text = "I don't think so.";
            }

        }

        private void backButton_Click(object sender, RoutedEventArgs e)
        {
            sudokuControl.BackOne();
        }

        private void clearAllButton_Click(object sender, RoutedEventArgs e)
        {
            sudokuControl.ClearTable();
        }
    }
}
